#!/bin/bash

source ~/.bashrc

if [[ $# -eq 0 ]]
then
	op_date=`date +%Y%m%d -d "-1 day"`
	#op_dateTime=`date +%H -d "-1 hour"`
elif [[ $# -eq 1 ]]
then
	op_date=$1
	#op_dateTime=$2
else
	echo "sh xx.sh 20150101"
fi

inputpath="/user/hive/warehouse/dianquan.db/dq_cashier_desk_pvuv/dt=$op_date*/"
outputpath="/tmpdq_cashier_desk_pvuv/dt=${op_date}"

"$(hdfs dfs -rm -r $outputpath)"

result="$(hadoop jar all_0.1.jar com.baidu.kpi.StatisticCodePvUvKpiMR $inputpath $outputpath $op_date)"
